<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript 初始化不会提升-实例1</title>
</head>

<body>
    <p id="demo"></p>
    <script>
        var x = 5; // 初始化 x
        var y = 7; // 初始化 y
        elem = document.getElementById("demo"); // 查找元素 
        elem.innerHTML = x + " " + y;           // 显示 x 和 y
    </script>
</body>

</html>